package com.starlz.jpa.entity;

import javax.persistence.*;
import java.util.Objects;

/**
 * @Description:
 * @Author: wangzi
 * @Date: 2018/11/20 09:15
 */
@Entity
@Table(name = "role", schema = "test", catalog = "")
public class LocalRole {
    private String id;
    private String roleName;

    @Id
    @Column(name = "id")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "role_name")
    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        LocalRole localRole = (LocalRole) o;
        return Objects.equals(id, localRole.id) &&
                Objects.equals(roleName, localRole.roleName);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, roleName);
    }
}
